<template>
    <el-switch v-model="theme" @change="themeChange"></el-switch>
</template>

<script>
import { mapState } from 'vuex';
import { breadcrumbGroup } from './theme.js';

export default {
    data() {
        return {
            theme: true,
            themeMap: [...breadcrumbGroup]
        }
    },
    computed: {
        ...mapState({
            isBreadcrumb: state => state.base.isBreadcrumb
        })
    },
    mounted() {
        this.theme = this.isBreadcrumb;
    },
    methods: {
        themeChange(mode) {
            this.$store.dispatch('setBaseState', {
                key: 'isBreadcrumb',
                value: this.theme
            })
        }
    }
}
</script>

<style>

</style>